

namespace Teriri.File.Server
{
    public class Program
    {
        public static void Main(string[] args)
        {
            AddConfig();

            IHost host = Host.CreateDefaultBuilder(args)
                .ConfigureServices(services =>
                {
                    services.AddHostedService<InitServerWorker>();
                })
                .Build();

            host.Run();
        }

        private static void AddConfig()
        {
            IConfigurationRoot configuration = new ConfigurationBuilder()
                .SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
                .AddJsonFile("appsettings.json")
                .Build()
                .ReadConfig<ServerConfig>();
        }

    }
}